<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:p="http://primefaces.org/ui">
 <h:head>
</h:head>
   <h:body>
   
   <h:form >
 	 <p:messages  id="loginMessage" showDetail="true"  closable="true" style="color:red"></p:messages> 
	<h:panelGrid>
	<f:facet name="header">Please log in:</f:facet>
	</h:panelGrid>
   <h:panelGrid columns="3" id="loginGrid">
   		<h:outputLabel for="loginUserName" value="User name:" ></h:outputLabel>
   		<p:inputText id="loginUserName" value="#{loginAction.userName}" label="LoginUserName" required="true"></p:inputText>
   		<h:message for="loginUserName" id="loginUserNameMsg"  style="color:red"/> 
   		<h:outputLabel for="loginPassword" value="Password:"></h:outputLabel>
   		<p:password id="loginPassword" value="#{loginAction.password}" label="LoginPassword" required="true"></p:password>
   		<h:message for="loginPassword" id="loginPasswordMsg"  style="color:red"/>
   		<f:facet name="footer">
   			<p:commandButton id="longinSubmit" value="Submit" action="#{loginAction.loginAction}" update="@form" ></p:commandButton>
   			<p:commandButton value="Sign up" type="button"
			onclick="PF('dlg').show();" />
   		</f:facet>
   </h:panelGrid> 
   </h:form>
   
<!-- <p:separator /> -->
   
   <!-- <h:form >
   <h:panelGrid>
   			<f:facet name="header">Add new user:</f:facet>
   </h:panelGrid>
   		<h:panelGrid columns="3" id="addGrid">
   			<h:outputLabel for="addUserName" value="User name:"></h:outputLabel>
   			<p:inputText id="addUserName" value="#{userAddAction.userName}" label="AddUserName"  required="true"></p:inputText>
   			<h:message for="addUserName" id="addUserNameMsg" style="color:red"></h:message>
   			
   			<h:outputLabel for="addPassword" value="Password:"></h:outputLabel>
   			<p:password id="addPassword" value="#{userAddAction.password}" label="AddPassword" required="true"/>
   			<h:message for="addPassword" id="addPasswordMsg" style="color:red"></h:message>
   			
   			<h:outputLabel for="confirmPassword" value="Confirm password:"></h:outputLabel>
   			<p:password id="confirmPassword" value="#{userAddAction.confirmPassword}" label="ConfirmPassword" required="true"></p:password>
   			<h:message for="confirmPassword" id="confirmPasswordMsg" style="color:red"></h:message>
   			
   			<f:facet name="footer">
   				<p:commandButton id="addSubmit" value="Submit" action="#{userAddAction.userAdd}"  update="@form"></p:commandButton>
   			</f:facet>
   		</h:panelGrid>  
   </h:form> -->

	<h:form>
		<!-- <p:commandButton value="Sign up" icon="ui-icon-extlink" actionListener="#{userAddAction.userAddDialog}" /> -->
		
		<p:dialog widgetVar="dlg" minHeight="40" modal="true" closeOnEscape="true">
		
		<p:messages id="addUserMessage" showDetail="true"  closable="true" style="color:red"></p:messages> 
			 <h:panelGrid>
				<f:facet name="header">Add new user:</f:facet>
			</h:panelGrid>
			<h:panelGrid columns="3" id="addGrid">
				<h:outputLabel for="addUserName" value="User name:"></h:outputLabel>
				<p:inputText id="addUserName" value="#{userAddAction.userName}"
					label="AddUserName" required="true"></p:inputText>
				<h:message for="addUserName" id="addUserNameMsg" style="color:red"></h:message>

				<h:outputLabel for="addPassword" value="Password:"></h:outputLabel>
				<p:password id="addPassword" value="#{userAddAction.password}"
					label="AddPassword" required="true" />
				<h:message for="addPassword" id="addPasswordMsg" style="color:red"></h:message>

				<h:outputLabel for="confirmPassword" value="Confirm password:"></h:outputLabel>
				<p:password id="confirmPassword"
					value="#{userAddAction.confirmPassword}" label="ConfirmPassword"
					required="true"></p:password>
				<h:message for="confirmPassword" id="confirmPasswordMsg"
					style="color:red"></h:message>

				<f:facet name="footer">
					<p:commandButton id="addSubmit" value="Submit"
						action="#{userAddAction.userAdd}" update="addUserMessage"></p:commandButton>
				</f:facet>
			</h:panelGrid>
		</p:dialog>
	</h:form>



	<!--   <h:form>
   <table>
   <tr><td>Add new user:</td></tr>
   <tr>	
   		<td><h:outputLabel value="user name:"></h:outputLabel></td>
   		<td><h:inputText id="addUserName" value="#{userAddAction.userName}" required="true"></h:inputText></td>
   </tr>
   <tr>
   		<td><h:outputLabel value="password:"></h:outputLabel></td>
   		<td><h:inputSecret id="addPassword" value="#{userAddAction.password}" required="true"></h:inputSecret></td>
  </tr>
  <tr>
  		<td><h:outputLabel value="confirm password:"></h:outputLabel></td>
  		<td><h:inputSecret id="confirmPassword" value="#{userAddAction.confirmPassword}" required="true"></h:inputSecret></td>
  		<td><h:commandButton id="addSubmit" value="Submit" action="#{userAddAction.userAdd}"></h:commandButton></td>
  </tr>
   </table>
   </h:form>   -->
   
   
   </h:body>
</html>

